﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace IdentityWebApi.Migrations
{
    public partial class addTableWordItem : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateTime",
                table: "T_User",
                type: "datetime2",
                nullable: false,
                defaultValue: new DateTime(2025, 4, 21, 14, 38, 15, 562, DateTimeKind.Local).AddTicks(4166),
                oldClrType: typeof(DateTime),
                oldType: "datetime2",
                oldDefaultValue: new DateTime(2025, 4, 13, 9, 47, 38, 232, DateTimeKind.Local).AddTicks(9953));

            migrationBuilder.AddColumn<long>(
                name: "JwtVersion",
                table: "T_User",
                type: "bigint",
                nullable: false,
                defaultValue: 0L);

            migrationBuilder.CreateTable(
                name: "T_WordItems",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Word = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Phonetic = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Definition = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Translation = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_WordItems", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "T_WordItems");

            migrationBuilder.DropColumn(
                name: "JwtVersion",
                table: "T_User");

            migrationBuilder.AlterColumn<DateTime>(
                name: "CreateTime",
                table: "T_User",
                type: "datetime2",
                nullable: false,
                defaultValue: new DateTime(2025, 4, 13, 9, 47, 38, 232, DateTimeKind.Local).AddTicks(9953),
                oldClrType: typeof(DateTime),
                oldType: "datetime2",
                oldDefaultValue: new DateTime(2025, 4, 21, 14, 38, 15, 562, DateTimeKind.Local).AddTicks(4166));
        }
    }
}
